package deepr.controller;

import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import deepr.ReplyLib;

import java.util.Map;

@Controller
@Slf4j
public class UserController {

    @ResponseBody
    @PostMapping(value = "/api/v1/user/login")
    public Map<String, Object> hello(String params) {
        JSONObject json = JSONObject.parseObject(params);
        log.info("deepr list, phone:{},password:{}", json.getString("phone"), json.get("password"));
        JSONObject map = new JSONObject();
        map.put("phone", json.getString("phone"));
        map.put("id", "whf");
        map.put("name", "whf");
        JSONObject reply = new JSONObject();
        reply.put("user", map);
        return ReplyLib.replyOk(reply);
    }
}
